package com.usefullc.system.controller;

import com.usefullc.system.entity.Pager;
import com.usefullc.system.entity.WebResult;
import com.usefullc.system.param.LocalInfoParam;
import com.usefullc.system.query.LocalInfoQuery;
import com.usefullc.system.domain.LocalInfo;
import com.usefullc.system.service.LocalInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping(path = "/system/localInfo/")
@Api( tags="国际化信息")
public class LocalInfoController {

    @Autowired
    private LocalInfoService localInfoService;


    @ApiOperation(value = "保存",response = WebResult.class)
    @PostMapping(path = "save",produces = "application/json")
    public WebResult save(@RequestBody LocalInfoParam localInfoParam) {
        localInfoService.saveByParam(localInfoParam);
        return WebResultBuilder.successResult();
    }




    @ApiOperation(value = "分页查询国际化信息",response = WebResult.class)
    @GetMapping(path = "/findByPage",produces = "application/json")
    public WebResult findByPage(LocalInfoQuery localInfoQuery) {
        Pager<LocalInfo> pager = localInfoService.findByPage(localInfoQuery);
        return WebResultBuilder.successResult(pager);
    }

}
